package com.mercury.security.service;

import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 用户模块
 *
 * @author mercury
 */
public class SysUserDetails extends User {

    /**
     * 用户ID
     */
    @Getter
    private final Long id;

    /**
     * 部门ID
     */
    @Getter
    private final Long deptId;

    /**
     * 手机号
     */
    @Getter
    private final String phone;

    public SysUserDetails(Long id, Long deptId, String username, String password, String phone, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.id = id;
        this.deptId = deptId;
        this.phone = phone;
    }
}
